#ifndef PUB_DEFS_H
#define PUB_DEFS_H

// #define M 400
// #define N 400
#define GEN 10000
#define VA(arr, i, j, n) arr[(i)*(n+2) + (j)]
typedef unsigned char uint8_t;

// void print_arr(uint8_t* arr);

void print_arr(uint8_t* arr, int m, int n);

void gameoflife_baseline(uint8_t* arr, const int m, const int n);

void gameoflife_optimized(uint8_t* arr, int m, int n, int rank, int size);

template<typename T>
int write_binfile(T* data, int n, const char* filepath);

template<typename T>
int read_binfile(T* data, int n, const char* filepath);

template<typename T>
bool compare_array(T* a, T* b, int n);

double wall_time();

#endif /* PUB_DEFS_H */